#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2005;

int n, m, k, x;
ll a[N][N];
bool check(ll val) {
  int cnt1 = 0, cnt2 = 0;
  rep(i, 1, n) {
    // cnt: how many elements in a[i] which are greater than val
    int cnt = a[i] + m + 1 - upper_bound(a[i] + 1, a[i] + m + 1, val);
    if (cnt > k - 1)
      cnt1 += cnt - (k - 1);  // need move some elements from a[i]
    if (cnt < k - 1) cnt2 += (k - 1) - cnt;  // could move some elements to a[i]
  }
  return cnt1 <= x && cnt1 <= cnt2;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  rep(i, 1, n) rep(j, 1, m) cin >> a[i][j];
  rep(i, 1, n) sort(a[i] + 1, a[i] + m + 1);

  cin >> k >> x;
  ll l = 1, r = 1e18;
  while (l <= r) {
    ll mid = (l + r) >> 1;
    if (check(mid))
      r = mid - 1;
    else
      l = mid + 1;
  }
  cout << l;
  return 0;
}